import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/components/index'

Vue.use(Router)

export const constantRouterMap = [
  // {path: '', component: () => import('@/views/Welcome'), hidden: true},
  {path: '/login', component: () => import('@/views/Login'), hidden: true},
  {path: '/forgetPassword', component: () => import('@/views/ForgetPassword'), hidden: true},
  {path: '/404', component: () => import('@/views/404'), hidden: true},
  {
    path: '/',
    component: Layout,
    redirect: '/race-manage',
    name: 'Layout',
    hidden: true,
    children: [
      {
        path: 'user-manage',
        name: 'userLink',
        component: () => import('@/views/user/UserList')
      },
      {
        path: 'province-manage',
        name: 'provinceLink',
        component: () => import('@/views/prov/ProvinceList')
      },
      {
        path: 'sponsor-manage',
        name: 'sponsorLink',
        component: () => import('@/views/org/SponsorList')
      },
      {
        path: 'web-manage',
        name: 'webLink',
        component: () => import('@/views/web/WebList')
      },
      {
        path: 'race-manage',
        name: 'raceLink',
        component: () => import('@/views/race/raceList')
      },
      {
        path: 'raceresult-manage',
        name: 'raceresultLink',
        component: () => import('@/views/race/raceresultList')
      },
      {
        path: 'log-manage',
        name: 'logLink',
        component: () => import('@/views/log/ActionLogsList')
      },
      {
        path: 'spiderlog-manage',
        name: 'spiderlogLink',
        component: () => import('@/views/log/SpiderLogsList')
      },
      {
        path: 'spiderlogerr-manage',
        name: 'spiderlogErrLink',
        component: () => import('@/views/log/SpiderLogErrsList')
      },
      {
        path: 'announce-list',
        name: 'announceList',
        component: () => import('@/views/announce/announceList')
      },
      {
        path: 'receipt-list',
        name: 'receiptList',
        component: () => import('@/views/receipt/receiptList')
      },
      {
        path: 'system-config',
        name: 'systemConfig',
        component: () => import('@/views/config/systemConfig')
      },
      {
        path: 'qingnian',
        name: 'qingnian',
        component: () => import('@/views/tools/Qingnian')
      },
      {
        path: 'match-list',
        name: 'matchList',
        component: () => import('@/views/match/MatchList')
      },
      {
        path: 'verify-list',
        name: 'VerifyList',
        component: () => import('@/views/match/VerifyList')
      },
      {
        path: 'racelh-manage',
        name: 'raceLHLink',
        component: () => import('@/views/race/raceLHList')
      }
    ]
  },
  {path: '*', redirect: '/race-manage', hidden: true}
]

export default new Router({
  // mode: 'history',
  routes: constantRouterMap
})
